package Message;

import java.io.Serializable;
import java.sql.Timestamp;


/**
 * 好友申请消息类
 * */
public class AccountAddFriendInfo implements Serializable {
    private String userIdInDatabaseFrom;  //发送者
    private String userIdInDatabaseTo;  //接受者
    private java.sql.Timestamp time; //发送消息的时间
    private String messageInfo; //发送的消息
    private Boolean agree=false;

    public AccountAddFriendInfo(String userIdInDatabaseFrom, String userIdInDatabaseTo, String messageInfo){
        this.userIdInDatabaseFrom = userIdInDatabaseFrom;
        this.userIdInDatabaseTo = userIdInDatabaseTo;
        this.messageInfo = messageInfo;
        this.time = new Timestamp(System.currentTimeMillis()); //默认设置发送消息时间是现在
    }

    public AccountAddFriendInfo(String userIdInDatabaseFrom, String userIdInDatabaseTo, String messageInfo, Timestamp time){
        this.userIdInDatabaseFrom = userIdInDatabaseFrom;
        this.userIdInDatabaseTo = userIdInDatabaseTo;
        this.messageInfo = messageInfo;
        this.time = time; //默认设置发送消息时间是现在
    }

    public AccountAddFriendInfo(String userIdInDatabaseFrom, String userIdInDatabaseTo, String messageInfo, Timestamp time, Boolean agree){
        this.userIdInDatabaseFrom = userIdInDatabaseFrom;
        this.userIdInDatabaseTo = userIdInDatabaseTo;
        this.messageInfo = messageInfo;
        this.time = time; //默认设置发送消息时间是现在
        this.agree = agree;
    }


    public String getUserIdInDatabaseFrom() {
        return userIdInDatabaseFrom;
    }

    public String getUserIdInDatabaseTo() {
        return userIdInDatabaseTo;
    }

    public Timestamp getTime() {
        return time;
    }

    public String getMessageInfo() {
        return messageInfo;
    }

    public Boolean getAgree() {
        return agree;
    }

    public String getInfo() {
        return getUserIdInDatabaseFrom() + "\t" + getUserIdInDatabaseTo() + "\t" +
                getTime() + "\t" + getMessageInfo() + "\t" + getAgree();
    }
}
